package LanQiao;

public class Demo1 {

    public static void main(String[] args) {
        int ret = 2;
        for (int i = 3; i < 2024; i++) {
            if (isPrim(i)) {
//                System.out.println(i);
                ret = i;
            }
        }

        System.out.println(ret);
    }

    private static boolean isPrim(int num) {
        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                return false;
            }
        }

        return true;
    }
}
